package com.icangya.DAO.impl;

import com.icangya.DAO.IFbTipDAO;
import com.icangya.domain.FbTip;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
public class FbTipDAOImpl extends  BaseDAO<FbTip> implements IFbTipDAO {

    Logger logger = LoggerFactory.getLogger(this.getClass());


    @Override
    public FbTip getFbTip() {
        String hql=" FROM FbTip ft  ORDER BY ft.createTime desc";
       List list= getHibernateTemplate().find(hql);
       logger.info(list.size()+"================================          fb.size");
       if(list.size()>0)
           return (FbTip) list.get(0);
        return  null;
    }
}
